﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Goway.StackingUC.Entity
{
    /// <summary>
    /// 协议消息地址
    /// </summary>
    public class ProtocolAddress
    {
        #region 写入地址

        /// <summary>
        /// 心跳
        /// </summary>
        public const int W_HEARTBEAT = 1000;

        /// <summary>
        /// 运行状态
        /// </summary>
        public const int W_RUN_STATUS = 1001;

        /// <summary>
        /// MES扫码完成标志
        /// </summary>
        public const int W_SCAN_FINISHED = 1002;

        /// <summary>
        /// MES收到入库缓存完成
        /// </summary>
        public const int W_RECV_INPUT_BUFFER_FINISHED = 1003;

        /// <summary>
        /// 收到入库缓存取料完成
        /// </summary>
        public const int W_RECV_INPUT_BUFFER_TAKE_FINISHED = 1004;

        /// <summary>
        /// 下发指令位
        /// </summary>
        public const int W_ORDER = 1005;

        /// <summary>
        /// 收到任务完成标记
        /// </summary>
        public const int W_RECV_TASK_FINISHED_FLAG = 1006;

        /// <summary>
        /// 取料坐标 ARRAY[1..8,1..3] OF INT   面/列/层  24Int
        /// </summary>
        public const int W_FROM_COORDINATE = 1100;

        /// <summary>
        /// 放料坐标 ARRAY[1..8,1..3] OF INT   面/列/层 24Int
        /// </summary>
        public const int W_TO_COORDINATE = 1200;

        /// <summary>
        /// 入库信息  ARRAY[1..2,1..3] OF INT  【（起点/终点），（面/列/层）】 8Int
        /// </summary>
        public const int W_INUPT_BUFFER_ADDR = 1300;

        #endregion

        #region 读取地址

        /// <summary>
        /// 心跳
        /// </summary>
        public const int R_HEARTBEAT = 1500;

        /// <summary>
        /// 运行状态  0:停止/手动中 ；1:自动运行中
        /// </summary>
        public const int R_RUN_STATUS = 1501;

        /// <summary>
        /// 堆垛机忙碌
        /// </summary>
        public const int R_BUSY_STATUS = 1502;

        /// <summary>
        /// 请求扫码
        /// </summary>
        public const int R_Stacking_REQUEST_SCAN_BARCODE = 1503;

        /// <summary>
        /// Stacking收到扫码完成
        /// </summary>
        public const int R_RECV_SCAN_FINISHED_FLAG = 1504;

        /// <summary>
        /// 入库缓存完成
        /// </summary>
        public const int R_INPUT_BUFFER_FINISHED = 1505;

        /// <summary>
        /// 入库缓存取料完成
        /// </summary>
        public const int R_INPUT_BUFFER_TAKE_FINISHED = 1506;

        /// <summary>
        /// 入库缓存个数
        /// </summary>
        public const int R_INPUT_BUFFER_COUNT = 1507;

        /// <summary>
        /// 入库缓存状态
        /// </summary>
        public const int R_INPUT_BUFFER_STATUS = 1508;

        /// <summary>
        /// 出库缓存状态
        /// </summary>
        public const int R_OUTPUT_BUFFER_STATUS = 1509;

        /// <summary>
        /// 收到任务标记
        /// </summary>
        public const int R_RECEIVED_TASK_FLAG = 1510;

        /// <summary>
        /// 任务完成标记
        /// </summary>
        public const int R_TASK_FINISHED_FLAG = 1511;

        /// <summary>
        /// 放料位置故障 ARRAY[1..8] OF INT
        /// </summary>
        public const int R_TO_PLACE_MALFUNCTION = 1550;

        /// <summary>
        /// 临时库位数量 ARRAY[1..2,1..26] OF INT
        /// </summary>
        public const int R_TEMP_STORAGE_LOCATION_COUNT = 1600;

        /// <summary>
        /// 正常库位数量 ARRAY[1..2,1..26] OF INT
        /// </summary>
        public const int R_MAIN_STORAGE_LOCATION_COUNT = 1700;

        /// <summary>
        /// 入库缓存起点信息
        /// </summary>
        public const int R_INPUT_BEGIN_ADDR = 1800;

        /// <summary>
        /// 入库终点信息
        /// </summary>
        public const int R_INPUT_END_ADDR = 1850;

        #endregion

        #region 数据长度

        /// <summary>
        /// 放料位置故障信息  ARRAY[1..8] OF INT
        /// </summary>
        public const int MALFUNCTION_TOCOORD_LENGTH = 8;

        /// <summary>
        /// 取放料坐标
        /// </summary>
        public const int TAKE_MATERIAL_COORDINATE_LENGTH = 24;

        /// <summary>
        /// 入库信息长度 ARRAY[1..2,1..3] OF INT  【（起点/终点），（面/列/层）】
        /// </summary>
        public const int INPUT_INFO_LENGTH = 6;

        /// <summary>
        /// 临时、正常库位数量  ARRAY[1..2,1..26] OF INT
        /// </summary>
        public const int SPACE_COUNT = 52;

        /// <summary>
        /// 入库缓存起点、终点信息 ARRAY[1..8,1..3] OF INT  面/列/层
        /// </summary>
        public const int INPUT_BUFFER_COORDNATE_LENGTH = 24;

        #endregion
    }
}
